package com.example.hms.controller;
import com.example.hms.entity.RoomType;
import com.example.hms.service.RoomTypeService;
import com.example.hms.ulit.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.math.BigDecimal;

@RestController()
@RequestMapping("/roomType")
public class RoomTypeController {
    //    动态注入下一层RoomTypeService（服务层）
    @Resource
    private RoomTypeService roomTypeService;
    @RequestMapping(value = "/selectAllRoomType",method = RequestMethod.GET)
    public Result selectAllRoomType(String roomTypeName, BigDecimal roomPrice) {
        return roomTypeService.selectAllRoomType(roomTypeName, roomPrice);
    }
    @RequestMapping(value = "/insert",method = RequestMethod.GET)
    public Result insert( RoomType roomType) {
        return roomTypeService.insert(roomType);
    }
    @RequestMapping(value = "/update",method = RequestMethod.GET)
    public Result update(RoomType roomType) {
        return roomTypeService.update(roomType);

    }
    @RequestMapping(value = "/delete",method = RequestMethod.GET)
    public Result delete(String roomTypeId) {
        return roomTypeService.delete(roomTypeId);
    }
}
